package com.guaoran.source.mybatis.v2.plugin;


import com.guaoran.source.mybatis.v2.execute.Executor;
import com.guaoran.source.mybatis.v2.mapper.MapperRegistry;

/**
 * @author : 孤傲然
 * @Description :
 *  自定义plugin方法
 * @date :2018/5/27 7:44
 */
@Intercepts({
        @Signature(
                type = Executor.class,
                method = "query",
                args = {MapperRegistry.KnownMappersInfo.class,Object.class}
        )
})
public class DemoPlugin implements Interceptor {
    @Override
    public Object plugin(Object target) {
        return Plugin.wrap(target,this);
    }

    @Override
    public Object intercept(Invocation invocation) throws Throwable {
        System.out.println("++++++++++++DemoPlugin++++intercept+++++++++++++++++");
        return invocation.proceed();
    }
}
